x86: Remove PSE flag from PV guest CR4 and CPUID.
authorKeir Fraser <keir.fraser@citrix.com>
Tue, 15 Sep 2009 08:23:44 +0000 (09:23 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Tue, 15 Sep 2009 08:23:44 +0000 (09:23 +0100)
From: Dave McCracken <dcm@mccr.org>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
xen/arch/x86/traps.c

index 6feb8ccdbd90414937aba3f58e3e0737ccc34577..e8116afe1c77dee2c73358d0269f672f0d886574 100644 (file)
@@ -752,8 +752,7 @@ static void pv_cpuid(struct cpu_user_regs *regs)
         __clear_bit(X86_FEATURE_VME, &d);
         if ( !cpu_has_apic )
             __clear_bit(X86_FEATURE_APIC, &d);
-        if ( !opt_allow_hugepage )
-            __clear_bit(X86_FEATURE_PSE, &d);
+        __clear_bit(X86_FEATURE_PSE, &d);
         __clear_bit(X86_FEATURE_PGE, &d);
         __clear_bit(X86_FEATURE_PSE36, &d);
     }
@@ -2064,12 +2063,10 @@ static int emulate_privileged_op(struct cpu_user_regs *regs)
         case 4: /* Read CR4 */
             /*
              * Guests can read CR4 to see what features Xen has enabled. We
-             * therefore lie about PGE as it is unavailable to guests.
-             * Also disallow PSE if hugepages are not enabled.
+             * therefore lie about PGE and PSE as they are unavailable to
+             * guests.
              */
-            *reg = read_cr4() & ~X86_CR4_PGE;
-            if ( !opt_allow_hugepage )
-                *reg &= ~X86_CR4_PSE;
+            *reg = read_cr4() & ~(X86_CR4_PGE|X86_CR4_PSE);
             break;
 
         default: